package cn.xej.demo;

import java.util.ArrayList;
import java.util.List;
import java.util.Objects;

/**
 * @Author alicat.xu
 * @Date 2021/8/24 5:42 下午
 */
public class Test {
    public static void main(String[] args) {
//        Car car = new Car();

        User user1 = new User();
        User user2 = new User();

        List<User> list = new ArrayList<>();
        user1.setName("zhangsan");
        user1.setAge("12");

        user2.setName("wangwu");
        user2.setAge("23");
//        list.add(user1);
//        list.add(user2);


        list.stream().forEach(user -> {
            System.out.println(user);

            if (Objects.equals(user.getName(),"zhangsan")){
                user.setAge("22222");
            }

        });

        System.out.println(list);
//        Util.util(users,User.class);

    }
}
